<!--
 * @Date: 2019-11-06 10:43:31
 * @LastEditors: peng qiao
 * @LastEditTime: 2020-03-24 17:31:16
 -->
<template>
  <div class="service_info">
    <van-nav-bar
      title="服务指南"
      left-arrow
      @click-left="$router.go(-1)"
      fixed
    />
    <ul>
      <li v-for="o in contentList" :key="o.id" class="record_list">
        <p class="record_title">{{ o.agencyName }}</p>
        <p class="record_address">地址：{{ o.address }}</p>
        <p class="record_address">电话：{{ o.phone }}</p>
        <p class="record_address">
          <span>工作时间：</span><span>工作日 {{ o.inAmTime }} -- {{ o.inPmTime }}</span>
        </p>
        <p class="record_address date_box">
          <span>周六 {{o.satAmTime?`${ o.satAmTime } -- ${o.satPmTime}`:'休息'}}</span>
        </p>
        <p class="record_address date_box">
          <span>周日 {{o.sunAmTime?`${o.sunAmTime} -- ${o.sunPmTime}`:'休息'}}</span>
        </p>
      </li>
    </ul>
  </div>
</template>

<script>
import api from "@/controller/govService.js";
import constant from "@/controller/constant.js";
export default {
  data() {
    return {
      contentList: [],
      curPage: 1,
      pageSize: 10
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    getList() {
      api.service_guide_v1_page(this.curPage, this.pageSize).then(res => {
        if (res.code === "0") {
          if (
            (res.datas && res.datas.records.length === 0) ||
            res.datas === null
          ) {
            this.$toast("暂无服务指南");
            return;
          }
          this.contentList = res.datas.records;
        } else {
          if (res && res.msg) {
            this.$toast(res.msg);
          } else {
            this.$toast(constant.unusualMsg);
          }
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.service_info {
  background: #ffffff;
  height: 100%;

  .record_list {
    padding: 0 15px 9px;
    border-bottom: 1px solid rgba(226, 226, 226, 0.5);
  }

  .record_title {
    font-size: 16px;
    color: #333333;
    line-height: 24px;
    padding: 15px 0 10px 0;
  }

  .record_address {
    font-size: 12px;
    color: #666666;
    line-height: 16.5px;
    padding: 0 0 6px 0;
  }
  .date_box {
    padding: 0 0 6px 60px;
  }
}
</style>
